<template>
  <a-card :bordered="false" v-if="showHome">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <!-- <a-col :md="6" :sm="8">
            <a-form-item label="发行方名称">
              <a-input placeholder="请输入发行方名称" v-model="queryParam.issuerName"></a-input>
            </a-form-item>
          </a-col> -->
          <a-col :md="6" :sm="8">
            <a-form-item label="展会主题">
              <!-- <a-input placeholder="请输入展会主题" v-model="queryParam.theme"></a-input> -->
              <a-select defaultValue="" v-model="exhibiId" style="width: 90%;">
                <a-select-option key="" value="">请选择</a-select-option> 
                <a-select-option v-for="(val,index) in listDataCopy" :key="val.id" :value="val.id">{{val.theme}}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <!-- <a-button @click="handleAdd" v-if="userAuth2btn == '1'" type="primary">登记</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('发行方登记')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload> -->
      <a-button type="primary" v-if="userAuth2btn == '3' || userAuth2btn == '4'" style="background: #00c39b;border: 1px solid #00c39b;" key="1" @click="handleApplyYes">通过</a-button>
      <a-button type="primary" v-if="userAuth2btn == '3' || userAuth2btn == '4'" style="background: #ff4767;border: 1px solid #ff4767;" @click="handleApplyNo">拒绝</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
        <template slot="oldSlot" slot-scope="text,record">
          <ul style="list-style: none;padding: 0;margin:0;">
            <li v-for="(val,index) in text.split(',')">
              <span>{{val}}</span>
              <a style="margin-right:10px;float: right;" type="primary" v-if="text" @click="oldNewCli(record.worksIds,index)"> 详情 </a>
            </li>
          </ul>
        </template>
        <template slot="newSlot" slot-scope="text,record">
          <ul style="list-style: none;padding: 0;margin:0;">
            <li v-for="(val,index) in text.split(',')">
              <span>{{val}}</span>
              <span v-if="text" style="color:#F5222D;cursor: pointer;float: right;" @click="oldNewCli(record.newWorksIds,index)"> 详情 </span>
            </li>
          </ul>
        </template>
        <span slot="action" slot-scope="text, record">
          <!-- <a @click="handleEdit(record)" v-if="!(userAuth2btn == '1' && record.status!=0)">编辑</a> -->
          <span style="color:red;cursor: pointer;" @click="detailCli(record)">详情</span>
          <a-divider type="vertical" v-if="record.status!=1"/>
          <span style="color:red;cursor: pointer;" v-if="record.status!=1" @click="editCli(record)">编辑</span>
          <a-divider type="vertical"  v-if="record.status==0"/>
          <a-popconfirm v-if="record.status == 0" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>取消参展</a>
          </a-popconfirm>
        </span>
        <span slot="status" slot-scope="text">
          <span v-if="text == 0">未开启</span>
          <span v-if="text == 1">进行中</span>
          <span v-if="text == 2">已结束</span>
        </span>
        <span slot="time" slot-scope="text, record">
          {{record.startTime+" 至 "+record.endTime}}
        </span>

      </a-table>
      <a-modal v-model="visible" title="编辑" ok-text="确认" cancel-text="取消" @ok="hideModal">
        <a-spin :spinning="confirmLoading">
          <a-form :form="form">
              <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="在售剧本">
              <a-checkbox-group v-model ="defaultNameOld" @change="onChangeOld">
                  <a-checkbox v-for="(item, key) in specification" :disabled="nameOld && nameOld.indexOf(item.productName)!=-1" :value="item.productName+'/'+item.id">{{ item.productName }}</a-checkbox>
              </a-checkbox-group>
              <div style="border:1px solid #FF5252;border-radius: 13px;padding: 2px 5px;font-size: 12px;cursor: pointer;width: 83px;height: 26px;line-height: 21px;" @click="jumpPro(1)">
                <img style="margin-top:-4px;" src="../../assets/product-icon-add.svg" alt="">
                添加商品
              </div>
              </a-form-item>
              <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="预售剧本">
              <a-checkbox-group v-model="defaultNameNew" @change="onChangeNew">
                  <a-checkbox v-for="(item, key) in specificationNew" :disabled="nameNew && nameNew.indexOf(item.productName)!=-1" :value="item.productName+'/'+item.id">{{ item.productName }}</a-checkbox>
              </a-checkbox-group>
              <div style="border:1px solid #FF5252;border-radius: 13px;padding: 2px 5px;font-size: 12px;cursor: pointer;width: 83px;height: 26px;line-height: 21px;" @click="jumpPro(2)">
                <img style="margin-top:-4px;" src="../../assets/product-icon-add.svg" alt="">
                添加商品
              </div>
              </a-form-item>
              <a-form-item 
              v-if="locationType == 1"
              class="checkbxGroup"
              style="overflow: hidden;"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="选择展位">
              <!-- <a-checkbox-group style="width:575px;white-space:nowrap;" v-for="(val,index) in enList.ens" v-model="boothNumSel"  v-decorator="['boothNum', {}]">
              </a-checkbox-group> -->
              <a-row>
                <a-col
                v-for="(val,index) in enList.ens"
                >                
                  <a-checkbox v-for="(item, key) in numList" v-decorator="['boothNum', {}]" :disabled="(boothNums.indexOf(val+item)!=-1 && boothNumSel.indexOf(val+item)==-1) || boothNumSel.indexOf(val+item)!=-1" :defaultChecked="boothNumSel.indexOf(val+item)!=-1" :value="val+item" @change="houseChange(val+item)">{{ val+item }}</a-checkbox>
                </a-col>
              </a-row>
              </a-form-item>
              <a-form-item 
              v-if="locationType == 0"
              class="checkbxGroup"
              style="overflow: scroll;"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="选择酒店房间">
              <a-row>
                <!-- <a-checkbox-group style="width:575px;white-space:nowrap;" v-decorator="['boothNum', {}]"> -->
                  <a-col
                  v-for="(val,index) in enList.ens"
                  >                
                    <a-checkbox v-for="(item, key) in val" :disabled="(boothNums.indexOf(item)!=-1 && boothNumSel.indexOf(item)==-1) || boothNumSel.indexOf(item)!=-1" :defaultChecked="boothNumSel.indexOf(item)!=-1" :value="item" @change="houseChange(item)">{{ item }}</a-checkbox>
                  </a-col>
                <!-- </a-checkbox-group> -->
              </a-row>
              </a-form-item>
          </a-form>
          </a-spin>
      </a-modal>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <exhibition_issuer_register-modal ref="modalForm" @ok="modalFormOk"></exhibition_issuer_register-modal>
    <BlockProductStandardsAll v-if="showAll" :listData="listData" @returnUp="returnUp"></BlockProductStandardsAll>    
  </a-card>
  <div v-else style="background:#fff;padding:25px 30px;">
      <div style="border-bottom:1px solid #e8e8e8;padding-bottom:30px;">
        <div style="font-size:16px;font-weight:bold;">
          参展信息          
          <img style="float: right;" @click="showHome = true" src="../../assets/close_icon.svg" alt="">
        </div>
        <div style="display:flex;justify-content: space-between;margin-top:15px;">
          <div style="width:33%;">
            <span>展会名称：</span>   
            <span>{{dataList.theme}}</span>
          </div>
          <div style="width:33%;">
            <span>举办地址：</span>   
            <span>{{dataList.address}}</span>
          </div>
          <div style="width:33%;">
            <span>举办时间：</span>   
            <span>{{dataList.startTime+" 至 "+dataList.endTime}}</span>
          </div>
        </div>
        <div style="display:flex;justify-content: space-between;margin-top:15px;">
          <div style="width:33%;">
            <span>展位/房间号：</span>   
            <span>{{dataList.boothNum}}</span>
          </div>
          <div style="width:33%;">
            <span>在售商品：</span>   
            <span>{{dataList.worksIdsName}}</span>
          </div>
          <div style="width:33%;">
            <span>预售商品：</span>   
            <span>{{dataList.newWorksIdsName}}</span>
          </div>
        </div>
        <div style="display:flex;justify-content:baseline;margin-top:15px;">
          <div style="width:33%;">
            <span>审核状态：</span>   
            <span v-if="dataList.status==0">未审核</span>
            <span v-if="dataList.status==1">通过</span>
            <span v-if="dataList.status==2">拒绝</span>
            <span v-if="dataList.status==3">审核中</span>
          </div>
          <div style="width:33%;">
            <span>展会状态：</span>   
            <span v-if="dataList.meetingStatus==0">未开启</span>
            <span v-if="dataList.meetingStatus==1">进行中</span>
            <span v-if="dataList.meetingStatus==2">已结束</span>
          </div>
        </div>
      </div>
      <div>
        <div style="margin:40px 0 30px 0;font-weight:bold;font-size:16px;">展位详情</div>
        <a-table :columns="columnsBooth" :data-source="listBlockBooth" :pagination="false">
          <template slot="qrSlot" slot-scope="text">
            <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
            <div v-else @click="jumpProview(text)">
              <img :src="text" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
            </div>
          </template>
          <template slot="hoteNumSlot" slot-scope="text,record">
            <span v-if="record.locationType == 0">{{record.hotelNumber}}</span>
            <span v-if="record.locationType == 1">{{record.lineNumber+record.columnNumber}}</span>
          </template>
          
          </span>
        </a-table>
        <div style="margin:40px 0 30px 0;font-weight:bold;font-size:16px;">组局详情</div>
        <a-table :columns="columnsPro" :data-source="listBlock" :pagination="false">
          <!-- <span slot="action" slot-scope="text, record">
            <a-popconfirm v-if="record.meetingStatus == 0" title="'是否撤销剧本'+text+'？撤销后该剧本将不可参展，请谨慎操作！'" @confirm="() => handleDelete(record.id)">
              <a>撤销</a>
            </a-popconfirm> -->
            <span slot="timeSlot" slot-scope="text">
              <span v-if="text == 1">上午场</span>
              <span v-if="text == 2">下午场</span>
              <span v-if="text == 3">晚场</span>
            </span>
            <span slot="stateSlot" slot-scope="text">
              <span v-if="text == 1">未开启</span>
              <span v-if="text == 2">进行中</span>
              <span v-if="text == 3">已结束</span>
            </span>
            <span slot="dateSlot" slot-scope="text">
              <span>{{formatDateTime(text)}}</span>
            </span>
            
          </span>
        </a-table>
        <!-- <div style="margin:40px 0 30px 0;font-weight:bold;font-size:16px;">在售商品</div>
        <a-table :columns="columnsPro" :data-source="dataOld" :pagination="false">
          <span slot="action" slot-scope="text, record">
            <a-popconfirm v-if="record.meetingStatus == 0" title="'是否撤销剧本'+text+'？撤销后该剧本将不可参展，请谨慎操作！'" @confirm="() => handleDelete(record.id)">
              <a>撤销</a>
            </a-popconfirm>
          </span>
        </a-table> -->
      </div>
      <JProviewImg v-if="showImg" @closeProview="showImg=false" :imgurl="proviewUrl"></JProviewImg>
  </div>
</template>

<script>
  import Exhibition_issuer_registerModal from './modules/Exhibition_issuer_registerModal'
  import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { postAction,getAction,httpAction } from '@/api/manage'
  import BlockProductStandardsAll from '../exhibition/modules/BlockProductStandardsAll'
  import JProviewImg from '@/components/jeecg/JProviewImg'

  export default {
    name: "Exhibition_issuer_registerList",
    mixins:[JeecgListMixin],
    components: {
      Exhibition_issuer_registerModal,
      BlockProductStandardsAll,
      JProviewImg
    },
    data () {
      return {
        nameOld:"",
        nameNew:"",
        exhibiId:"",
        showImg:false,
        proviewUrl:"",
        listDataCopy:[],
        visible:false,
        boothNum:[],
        numList:[],
        boothNums:"",
        boothNumSel:'',
        defaultNameOld:[],
        defaultNameNew:[],
        ethId:"",
        enList:{},
        listNameOld:"",
        listNameNew:"",
        listIdOld:"",
        listIdNew:"",
        specification:[],
        specificationNew:[],
        confirmLoading: false,
        form: this.$form.createForm(this),
        locationType:0,
        labelCol: {
            xs: { span: 24 },
            sm: { span: 5 },
        },
        wrapperCol: {
            xs: { span: 24 },
            sm: { span: 16 },
        },
        listBlockBooth:[],
        columnsBooth:[
          {
            title: '展位号',
            align:"center",
            dataIndex: 'hotelNumber',
            scopedSlots: { customRender: 'hoteNumSlot' }
           },
           {
            title: '展位码',
            align:"center",
            dataIndex: 'captcha'
           },
           {
            title: '展位二维码',
            align:"center",
            dataIndex: 'tickets',
            scopedSlots: { customRender: 'qrSlot' }
           }
        ],
        columnsPro:[
          {
            title: '商品名称',
            align:"center",
            dataIndex: 'name'
           },
           {
            title: '房间/展位',
            align:"center",
            dataIndex: 'field'
           },
           {
            title: '场次日期',
            align:"center",
            dataIndex: 'sceneDate',
            scopedSlots: { customRender: 'dateSlot' }
           },           
           {
            title: '场次',
            align:"center",
            dataIndex: 'timeSlot',
            scopedSlots: { customRender: 'timeSlot' },
           },
           {
            title: '报名时间',
            align:"center",
            dataIndex: 'registrationTime',
           },
           {
            title: '发车时间',
            align:"center",
            dataIndex: 'departureTime'
           },
           {
            title: '组局状态',
            align:"center",
            dataIndex: 'state',
            scopedSlots: { customRender: 'stateSlot' },
           },
           {
            title: '展位码',
            align:"center",
            dataIndex: 'roomCode'
           },
           {
            title: '展位二维码',
            align:"center",
            dataIndex: 'roomQrCode',
            scopedSlots: { customRender: 'qrSlot' }
           },
          //  {
          //   title: '商品二维码',
          //   align:"center",
          //   dataIndex: 'name'
          //  },
          //   {
          //   title: '操作',
          //   dataIndex: 'action',
          //   align:"center",
          //   scopedSlots: { customRender: 'action' },
          // }
        ],
        showHome:true,
        description: '发行方登记管理页面',
        showAll:false,
        listData:{},
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
		      // {
          //   title: '发行方名称',
          //   align:"center",
          //   dataIndex: 'issuerName'
          //  },
		      {
            title: '展会主题',
            align:"center",
            dataIndex: 'theme'
           },
           {
            title: '展会状态',
            align:"center",
            dataIndex: 'meetingStatus',
            scopedSlots: { customRender: 'status' } 
           },
           {
            title: '举办地址',
            align:"center",
            dataIndex: 'address'
           },
          //  {
          //   title: '在售作品',
          //   align:"center",
          //   dataIndex: 'worksIdsName',
          //   scopedSlots: { customRender: 'oldSlot' }
          //  },
          //  {
          //   title: '预售作品',
          //   align:"center",
          //   dataIndex: 'newWorksIdsName',
          //   scopedSlots: { customRender: 'newSlot' }
          //  },
           {
            title: '举办时间',
            align:"center",
            dataIndex: 'startTime',
            scopedSlots: { customRender: 'time' } 
          },
		      // {
          //   title: '展位码',
          //   align:"center",
          //   dataIndex: 'boothNum'
          // },
		      {
            title: '审核状态',
            align:"center",
            dataIndex: 'status',
            customRender: text => {
              return filterMultiDictText(this.dictOptions['applyStatus'], text + '')
            }            
           },
           {
            title: '参展时间',
            align:"center",
            dataIndex: 'createTime'
           },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        userAuth2btn:"1",
        url: {
            list: "/exhibition/exhibition_issuer_register/list",
            delete: "/exhibition/exhibition_issuer_register/delete",
            deleteBatch: "/exhibition/exhibition_issuer_register/deleteBatch",
            exportXlsUrl: "exhibition/exhibition_issuer_register/exportXls",
            importExcelUrl: "exhibition/exhibition_issuer_register/importExcel",
            apply:"/exhibition/exhibition_issuer_register/audit"
          },
        dictOptions: {
          applyStatus: []
        },
        dataList:{},
        dataNew:[],
        dataOld:[],
        issuerId:'',
        listBlock:[]
    }
  },
  mounted(){
    this.listInt();
    getAction("/block/blockManufacturerInfo/userAuth2btn")
        .then(res => {
          if (res.success) {
            this.userAuth2btn = res.result.status;
          } else {
            that.$message.warning(res.message)
          }
        })
    var param={
      productStandardsId: "1216548480059949057",
      order: "asc",
      field: "",
      pageNo: 1,
      pageSize: 1000
    };
    getAction("/exhibition/exhibition_product_standards_new/list",param).then((res) => {
      if (res.success) {
        var list = res.result.records;
        // this.specificationNew = res.result.records;
        for(let i=0;i<list.length;i++){
          if(list[i].newOldStatus == 0){
            this.specification.push(list[i]);
          }
          if(list[i].newOldStatus == 1){
            this.specificationNew.push(list[i]);
          }
        }
      }
      if(res.code===510){
        this.$message.warning(res.message)
      }
    })    
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
  methods: {
    jumpProview(val){
      this.showImg = true;
      this.proviewUrl = val;
    },
    formatDateTime (date) {
      var dateee = new Date(date).toJSON();
      return new Date(+new Date(dateee)+8*3600*1000).toISOString().replace(/T/g,' ').replace(/\.[\d]{3}Z/,'')
    },
    searchQuery(){
      var params={
        exhibitionMeetingId: this.exhibiId,
        column: 'createTime',
        order: 'desc',
        field: 'id,,,theme,meetingStatus,address,startTime,status,createTime,action',
        pageNo: 1,
        pageSize: 10
      };
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records;
          this.ipagination.total = res.result.total;
        }
        if(res.code===510){
          this.$message.warning(res.message)
        }
        this.loading = false;
      })
    },
    listInt(){
        this.exhibiId = "";
        var list= {
            column: 'createTime',
            order: 'desc',
            field: 'id,,,theme,address,boothNum,ticketsNum,columnNumber,lineNumber,startTime,endTime,ticketsNum,poster1,licenseFile,remark,action',
            pageNo: 1,
            pageSize: 10
        }
        getAction("/exhibition/exhibition_meeting_info/list",list)
            .then(res => {
                if (res.success) {
                    this.listData = res.result.records;
                    this.listDataCopy=JSON.parse(JSON.stringify(this.listData));
                }
            })
        let listVal={
          column: "createTime",
          order: "desc",
          field: "id,,factoryName,companyProfile,createTime,type,name,status,address,phone,imageurl,action",
          pageNo: 1,
          pageSize: 5
        };
        getAction("/block/blockManufacturerInfo/list",listVal).then((res)=>{
          if (res.success) {
            this.issuerId = res.result.records[0].id;
          } else {
            this.$message.warning(res.message)
          }
        })
      },
    houseChange(value){
      if(this.dataList.boothNum.indexOf(value) == -1){
        this.dataList.boothNum+=(value+';');
      }else{
        this.dataList.boothNum = this.dataList.boothNum.replace(value+";","")
      }
    },
    onChangeNew(value){
        this.listNameNew = ""
        this.listIdNew = ""
        for(let i=0;i<value.length;i++){
        if(i == 0){
            this.listNameNew += value[i].split('/')[0];
            this.listIdNew += value[i].split('/')[1];
        }else{
            this.listNameNew +="," + value[i].split('/')[0];
            this.listIdNew += "," + value[i].split('/')[1];
        }
        }
    },
    onChangeOld(value){
        this.listNameOld = ""
        this.listIdOld = ""
        for(let i=0;i<value.length;i++){
        if(i == 0){
            this.listNameOld += value[i].split('/')[0];
            this.listIdOld += value[i].split('/')[1];
        }else{            
            this.listNameOld +="," +  value[i].split('/')[0];
            this.listIdOld +="," +  value[i].split('/')[1];
        }
        }
    },
    hideModal() {
        const that = this;
        // 触发表单验证
        this.form.validateFields((err, values) => {
        if (!err) {
            that.confirmLoading = true;
            let httpurl = "/exhibition/exhibition_issuer_register/edit";
            let method = 'put';
            values.worksIds = this.listIdOld;
            values.exhibitionMeetingId = this.ethId;
            values.newWorksIds = this.listIdNew;
            values.worksIdsName = this.listNameOld;
            values.newWorksIdsName = this.listNameNew;
            values.id = that.dataList.id;
            if(!this.listIdOld && !this.listIdNew){
              that.$message.warning("请先选择剧本！");
              return
            }
            if(!this.dataList.boothNum){
            that.$message.warning("请先展位！");
            return
            }
            // var strVal = "";
            // for(var i=0;i<that.boothNum.length;i++){
            // strVal+=that.boothNum[i]+";";
            // }
            // values.boothNum = strVal;
            values.boothNum = this.dataList.boothNum;
            let formData = Object.assign({}, values);
            //时间格式化
            
            httpAction(httpurl,formData,method).then((res)=>{
                if(res.success){
                    that.$message.success(res.message);
                }else{
                    that.$message.warning(res.message);
                }
                that.loadData();
                that.confirmLoading = false;
                that.visible = false;
            })
        }
        })
    },
    editCli(data){
      var that=this;
      that.dataList = data;
      this.nameOld = data.worksIdsName.split(',');
      this.nameNew = data.newWorksIdsName.split(',');
      var nameOld = data.worksIdsName.split(',');
      var nameNew = data.newWorksIdsName.split(',');
      var idOld = data.worksIds.split(',');
      var idNew = data.newWorksIds.split(',');
      that.defaultNameOld = [];
      that.defaultNameNew = [];
      for(let i=0;i<idOld.length;i++){
        that.defaultNameOld.push(nameOld[i]+'/'+idOld[i])
      }
      for(let i=0;i<idNew.length;i++){
        that.defaultNameNew.push(nameNew[i]+'/'+idNew[i])
      }
      that.listNameOld = data.worksIdsName;
      that.listNameNew = data.newWorksIdsName;
      that.listIdOld = data.worksIds;
      that.listIdNew = data.newWorksIds;
      that.ethId = data.id;
      that.locationType = data.locationType;
      that.boothNumSel = data.boothNum;
      that.visible = true;
      that.$forceUpdate();
      postAction("/exhibition/exhibition_issuer_register/getBoothNumByMeetingId",{exhibitionMeetingId:data.exhibitionMeetingId}).then((res) => {
        if (res.success) {
          if(res.result.boothNums){
            that.boothNums = res.result.boothNums;
          }
            if(data.locationType == 0){
              // debugger
              // var hotelNumber = JSON.parse(data.hotelNumber);
              // var floorNumber = data.floorNumber;
              // that.enList.ens = [];
              // for (let i=0;i<hotelNumber.length; i++){
              //   if(hotelNumber[i].toString().indexOf('/') == -1){
              //     that.enList.ens.push([hotelNumber[i]]);
              //   }else{
              //     that.enList.ens.push(hotelNumber[i].split('/'));
              //   }
              // }
              var hotelNumber = data.hotelNumber.split(',');
              var floorNumber = Math.ceil((hotelNumber.length)/5);
              var yuNum = (hotelNumber.length)%5;
              this.enList.ens = [];
              for (let i=0;i<floorNumber; i++){
                var str = [];
                if(floorNumber == i+1 && yuNum!=0){
                  for(let j=0;j<yuNum;j++){
                    str.push(hotelNumber[(5*i)+j]);
                  }
                }else{
                  for(let j=0;j<5;j++){
                    str.push(hotelNumber[(5*i)+j]);
                  }
                }
                this.enList.ens.push(str);
              }
            }else{              
              var column = data.columnNumber;
              var line = data.lineNumber;
              that.numList = [];
              that.enList.ens = [];
              that.enList.nums = [];
              for (var i=0 ;i<column ; i++){
                  that.enList.ens.push(String.fromCharCode(i+65)); 
                  that.enList.nums.push(i+1);
              }
              for (var j=0 ;j<line ; j++){
                  that.numList.push(j+1); 
              }
            }
            that.$forceUpdate();
        }else{
            that.$message.warning(res.message)
        }
      })
    },
    detailCli(data){
      this.dataList = data;
      var exData={
        exhibition_meeting_id:data.exhibitionMeetingId,
        issuer_id:this.issuerId
      };
      getAction("/exhibition/exhibition_tickets/queryAllTickets",exData)
        .then(res => {
          this.listBlockBooth = res.result;
        })
      getAction("https://blockinsight.com.cn/blackExplorationExhibition/third/dramaBureauList?currentPage=1&pageSize=100&exhibitionId="+data.exhibitionMeetingId+"&issuerId="+this.issuerId)
        .then(res => {
          this.listBlock = res.data.data;
        })
      
      this.showHome = false;
      this.dataNew = [];
      this.dataOld = [];
      var newLi = data.newWorksIdsName.split(',');
      var oldLi = data.worksIdsName.split(',');
      for(var i=0;i<newLi.length;i++){
        this.dataNew.push({name:newLi[i]})
      }
      for(var i=0;i<oldLi.length;i++){
        this.dataOld.push({name:oldLi[i]})
      }
    },
    oldNewCli(list,index){     
        var pams = {
          id:list.split(',')[index]
        }
      getAction("/exhibition/exhibition_product_standards_new/list",pams)
        .then(res => {
          if (res.success) {
            this.showAll = true;
            this.listData = res.result.records[0];
          } else {
            that.$message.warning(res.message)
          }
        })
    },
    initDictConfig() {
      initDictOptions('apply_status').then(res => {
        if (res.success) {
          this.$set(this.dictOptions, 'applyStatus', res.result)
        }
      })
    },
    detailsCli(record){
      this.showAll=true;
      this.listData = record;
    },
    returnUp(data){
      this.showAll = data;
    },
    handleApplyYes(){
      this.applyMethod(this, 1)
    },
    handleApplyNo(){
      this.applyMethod(this, 2)
    },
    applyMethod(that, status) {
      var ids = '';
      if (that.selectedRowKeys.length <= 0) {
        that.$message.warning('请选择一条记录！')
        return
      }
      if (that.selectedRowKeys.length > 1) {
        that.$message.warning('只能选择一条记录！')
        return
      }
      for (var a = 0; a < that.selectedRowKeys.length; a++) {
        if(a == 0){
          ids += that.selectedRowKeys[a];
        }else{
          ids += ',' + that.selectedRowKeys[a];
        }
      }
      postAction(that.url.apply, { "id": ids, "status": status })
        .then(res => {
          if (res.success) {
            that.$message.success(res.message)
            that.loadData()
            that.onClearSelected()
          } else {
            that.$message.warning(res.message)
          }
        })
        .finally(() => {
          that.loading = false
        })
    },
  }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>